﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using agTweener;

namespace AphroditePiano.Controls
{
    public partial class IndicationKey : UserControl
    {

        private TweenParameter runTP = new TweenParameter();
        private TweenParameter hideTp = new TweenParameter();
        public IndicationKey()
        {
            InitializeComponent();
            runTP.time = 2;
            runTP.X = -450;
            runTP.transition = TransitionType.easeNone;

            hideTp.time = 0.2;
            hideTp.Opacity = 0;
            hideTp.transition = TransitionType.easeNone;
        }

        public void setTxt(string txt) {
            this.xTxt.Text = txt;
        }

        public void run() {
            Tweener.addTween(this, runTP, new TweenEvent(hide), null);
        }
        void hide(params object[] args)
        {
            Tweener.addTween(this, hideTp, new TweenEvent(remove), null);
        }
        void remove(params object[] args)
        {
            (this.Parent as Grid).Children.Remove(this);
        }
    }
}
